/*
********************************************************************************
* Copyright (C) 2021, xiang.D <dx_65535@163.com>.
* All right reserved.
*
* File Name   : consumer.h
* Author      :
* Version     : V1.0
* Description :
* Journal     : 2021-01-08 init v1.0
* Brief       : Blog: https://blog.csdn.net/qq_38750572?spm=1001.2014.3001.5343
* Others      :
********************************************************************************
*/
#ifndef __CONSUMER_H__
#define __CONSUMER_H__

#include <string>

class CConsumer
{
public:
    float mDiscountRate;
    std::string mUserDesc;

    CConsumer() : mDiscountRate(1.0)
    {

    }

    virtual ~CConsumer()
    {

    }

    void SetDiscountRate(float rate)
    {
        mDiscountRate = rate;
    }

    float GetDiscountRate()
    {
        return mDiscountRate;
    }

    float GetRealPrice(float price)
    {
        return mDiscountRate * price;
    }

    virtual int GetBirthdayPresent() = 0;
};

class CCommonUser : public CConsumer
{
public:
    CCommonUser();

    ~CCommonUser();

    static CCommonUser* GetInstance();

    int GetBirthdayPresent();
};

class CSilverUser : public CConsumer
{
public:
    CSilverUser();

    ~CSilverUser();

    static CSilverUser* GetInstance();

    int GetBirthdayPresent();
};

class CGoldUser : public CConsumer
{
public:
    CGoldUser();

    ~CGoldUser();

    static CGoldUser* GetInstance();

    int GetBirthdayPresent();
};

#endif
